package net.lbtech;


import com.alibaba.fastjson.JSONObject;
import com.github.stuxuhai.jpinyin.PinyinException;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import net.lbtech.util.IPUtil;
import net.lbtech.util.WeatherUtil;
import net.lbtech.util.db.DbBuilder;
import net.lbtech.util.exception.IpException;
import net.lbtech.util.exception.WeatherException;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;


public class AppTestIpGetSite
    extends TestCase {
    protected static Logger logger = LoggerFactory.getLogger(AppTestIpGetSite.class);

    /**
     * 根据IP获取城市
     */
    public void testGetCity(){
        try {
            String a = IPUtil.getCity("120.120.1.54");
            System.out.println(a);
        } catch (IpException e) {
            System.out.println(e);
        } catch (Exception e){
            System.out.println(e);
        }
    }


    /**
     * 根据IP获取城市，少了市，没有市的时候选择省。
     */
    public void testGetAddress() {

        String msg = "adfsafdasdsadasd";
        String reception = msg.replace("\r\n", "");

        if (reception.contains("aa")) {
            System.out.println("开始");

        }
    }


}